Skip to content

Comments

Toolbar - Context Menu height is incorrect on first open in React (T1322123)#32668

Merged
dmlvr merged 1 commit intoDevExpress:26_1from
dmlvr:T1322123_26_1
Feb 23, 2026
Merged

Toolbar - Context Menu height is incorrect on first open in React (T1322123)#32668
dmlvr merged 1 commit intoDevExpress:26_1from
dmlvr:T1322123_26_1

Conversation

@dmlvr
Copy link
Contributor

@dmlvr dmlvr commented Feb 20, 2026

No description provided.

@dmlvr dmlvr self-assigned this Feb 20, 2026
@dmlvr dmlvr requested a review from a team as a code owner February 20, 2026 19:02
Copilot AI review requested due to automatic review settings February 20, 2026 19:02
@dmlvr dmlvr added the 26_1 label Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an issue (T1322123) where the Toolbar context menu height is incorrect on first open in React when templatesRenderAsynchronously is enabled. The fix ensures that when list items are rendered asynchronously, the popup geometry is recalculated to accommodate the correct height.

Changes:

  • Added a _onItemsRendered callback to the ToolbarMenuList that triggers popup geometry recalculation when templatesRenderAsynchronously is true
  • Added a test case to verify that popup._renderGeometry is called from the list's _onItemsRendered callback when templatesRenderAsynchronously is enabled

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/devextreme/js/__internal/ui/toolbar/internal/toolbar.menu.ts Added _onItemsRendered callback to recalculate popup geometry when templates render asynchronously
packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.menu.tests.js Added test to verify popup geometry recalculation on items rendered

Copilot AI review requested due to automatic review settings February 21, 2026 06:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@@ -290,6 +290,23 @@ QUnit.module('render', moduleConfig, () => {
assert.strictEqual(this.overflowMenu.$popupContent().closest($container).length, 1, 'Popover content located into desired container');
});

QUnit.test('list._onItemsRendered should call popup._renderGeometry when templatesRenderAsynchronously = true (T1322123)', function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

Suggested change
QUnit.test('list._onItemsRendered should call popup._renderGeometry when templatesRenderAsynchronously = true (T1322123)', function(assert) {
QUnit.test('popup should have correct height after async item templates are rendered (T1322123)', function(assert) {
const templateRenderingTimeout = 10;
const itemHeight = 50;
this.instance.option({
items: [1, 2, 3],
templatesRenderAsynchronously: true,
integrationOptions: {
templates: {
'item': {
render({ model, container, onRendered }) {
setTimeout(() => {
const $item = $(`<div>${model}</div>`);
$item.css('height', itemHeight);
$item.appendTo(container);
onRendered();
}, templateRenderingTimeout);
}
}
}
},
});
this.overflowMenu.click();
this.clock.tick(templateRenderingTimeout);
const $overlayContent = this.overflowMenu.popup().$overlayContent();
const overlayContentHeight = getOuterHeight($overlayContent);
assert.strictEqual(this.overflowMenu.$items().length, 3, 'all items are rendered');
assert.strictEqual(overlayContentHeight, 197, 'popup height is updated');
});

@dmlvr dmlvr merged commit ff71254 into DevExpress:26_1 Feb 23, 2026
124 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants